import logging
import redis


class Config(object):
    SQLALCHEMY_DATABASE_URI = 'mysql://root:mysql@127.0.0.1/information'
    SQLALCHEMY_TRACK_MODIFICATIONS = False
    SQLALCHEMY_COMMIT_ON_TEARDOWN = True
    REDIS_HOST = '127.0.0.1'
    REDIS_PORT = 6379
    SECRET_KEY = '0n5D0cIJ9mv9K5pIBBwB0sEJnG3BFQxJGIeS6u/P9to='
    SESSION_TYPE = 'redis'
    SESSION_REDIS = redis.StrictRedis(host=REDIS_HOST, port=REDIS_PORT)
    SESSION_USE_SIGNER = 1
    PERMANENT_SESSION_LIFETIME = 60*60*24*7


class ProductionConfig(Config):
    # DATABASE_URI = 'mysql://user@localhost/foo'
    DEBUG = 0
    LOG_LEVEL = logging.WARNING


class DevelopmentConfig(Config):
    DEBUG = True
    LOG_LEVEL = logging.DEBUG
